﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CampDay16__User_Input_.Models;

namespace CampDay16__User_Input_.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {

            return View(DB.Dinos);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
        public ActionResult CreateDino()
        {

            return View(new Dinosaur());
        }
        [HttpPost]
        public ActionResult CreateDino(Dinosaur newDino)
        {
            DB.Create(newDino);
            return RedirectToAction("Index");
        }
    }
}